//	 require(['jquery',"ecp.component.export"] ,function($,ecpExport) {
//		 new ecpExport()
//	})
//导出界面
require(["ecp.export"],function(ecpExport){
	var option = {
			fileName : "费用报销单",
			showWindow : true,//弹出窗口
			template: false, //参数template为true表示只“导出模板”，为false表示只“导出数据”，不配置或为空时两者皆可导出
			rangeDisable: true,//参数rangeDisable为true表示“导出范围”不可用
			rangeHide: false,//参数rangeHide为true表示导出范围隐藏（导出卡片时为true）
			showExportFormat: false,//参数showExportFormat为true表示导出格式显示，默认隐藏
			pageNum:0,//参数pageNum为true表示表格的页数 （导出列表时必填项）
			/**
			 * 导出pdf的数据集
			 * 
			 * data参数如下：
			 * @param {String} range 其中0表示全部；1表示单前页；2表示范围，参照rangeInput
			 * @param {String} rangeInput  1或5-12或5-
			 * @param {String} mode 其中0表示导出数据；1表示导出模板
			 * @param {String} fileType 其中0表示xlsx；1表示xls；2表示wps；3表示pdf
			 * @param {String} format 其中0表示主、子表多页签导出，1表示主、子表单页签导出（不支持导入）
			 * callback参数是回调函数，需要调用者手动执行
			 * 
			 * @return obj 返回值对象属性如下
			 * @param {String} classid 类别Id
			 * @param {String} typeid 类型Id
			 * @param {String} data 数据对象
			 * @param {String} formatid 
			 * @param {String} hideItems
			 */
			pdfData: function(data, callback){
				var opt = {
					classid: "gris.ywdj",
					typeid: "3",
					data: '{"jcls":"com.ygsoft.ecp.app.ywdj.service.model.YwdjMainVO","accessories":"fs~XTYWBILLIMAGE~9","billid":9,"classId":"gris.ywdj","dwdh":"9999","gid":10,"modelState":1,"typeId":"3","xtywbillVO":{"jcls":"com.ygsoft.ecp.app.ywdj.service.model.XtywbillVO","billid":9,"billsource":0,"billtype":0,"bzwc":0,"codeid":38269696,"compid":"远光软件集团公司","dwdh":"远光软件集团公司","gid":9,"lasttime":"/Date(1484128347000+0800)/","modelState":1,"ttime":"2017-01-11","typeid":"3","year":2017},"year":2017,"ywid":9,"__dynamic":1,"_DISPLAYMODEL":{"ECP.TABLEENTITY":{"XTYHXX":{"500009":{"jcls":"com.ygsoft.ecp.component.ef.service.model.EntityItemIdNameVO","dataType":"ecp.tableentity","gid":"500009","modelState":1,"name":"lhfpt01","pgid":"XTYHXX","__dynamic":1}}},"ENUM":{"50000003":{"00000001":{"jcls":"com.ygsoft.ecp.component.ef.service.model.EntityItemIdNameVO","dataType":"ENUM","gid":"00000001","modelState":1,"name":"无","pgid":"50000003","__dynamic":1},"00000002":{"jcls":"com.ygsoft.ecp.component.ef.service.model.EntityItemIdNameVO","dataType":"ENUM","gid":"00000002","modelState":1,"name":"有辅助数量单位","pgid":"50000003","__dynamic":1},"00000003":{"jcls":"com.ygsoft.ecp.component.ef.service.model.EntityItemIdNameVO","dataType":"ENUM","gid":"00000003","modelState":1,"name":"有含量","pgid":"50000003","__dynamic":1}}},"ORGANISE":{"9999":{"jcls":"com.ygsoft.ecp.component.ef.service.model.EntityItemIdNameVO","dataType":"organise","gid":"9999","modelState":1,"name":"远光软件集团公司","__dynamic":1}},"REGION":{"*+df1.fullPath.region_id":{"1363b0d7b4728885692bdaf0948853ef":{"jcls":"com.ygsoft.ecp.component.ef.service.model.EntityItemIdNameVO","dataType":"REGION","gid":"1363b0d7b4728885692bdaf0948853ef","modelState":1,"name":"广东省\\珠海市\\香洲区\\唐家湾镇","pgid":"*+df1.fullPath.region_id","__dynamic":1}}}},"CZY":"lhfpt01","CWZZ":"远光软件集团公司","DQ":"广东省\\珠海市\\香洲区\\唐家湾镇","MJ":"有辅助数量单位","workflowTraces":[{"jcls":"com.ygsoft.ecp.core.workflow.engine.service.task.ProcessTraceVO","activityDefID":"ecpUserTask","activityInstID":22,"companyID":"9999","companyName":"远光软件集团公司","gid":"f240c7ca822d4c04aba16c6657562dc2","modelState":1,"operatorSequence":1,"operatorType":"待处理","operatorUser":"yxpt001","operatorUserID":"500027","postID":"7007","postName":"平台普通职员","processChName":"单据A（3.0）","sequenceNodeFlag":false,"stime":"/Date(1484128299000+0800)/","traceGid":"6e1fdb12eb994490bd883f63244da144","workItemDec":"填单","workItemID":21,"workItemState":6}]}',
					formatid: "83e79e5b00856de46386515aae465291",
					hideItems:""
				}
				callback(opt);//必须
			},
			/**
			 * 导出数据的数据集
			 * 
			 * data参数是对象
			 * @param {String} range 其中0表示全部；1表示单前页；2表示范围，参照rangeInput
			 * @param {String} rangeInput  1或5-12或5-
			 * @param {String} mode 其中0表示导出数据；1表示导出模板
			 * @param {String} fileType 其中0表示xlsx；1表示xls；2表示wps；3表示pdf
			 * @param {String} format 其中0表示主、子表多页签导出，1表示主、子表单页签导出（不支持导入）
			 * callback参数是回调函数，需要调用者手动执行
			 * 
			 * @return {Array} 返回对象数组
			 */
			dataList : function(data, callback){
				var dataList =
				[{
		   			 "tabName" : "test1",
		   			 "header":[{d:"名称", s:"h|c"}, "年龄", "电话", "地址"], 
	     			 "userData":[["张三丰", 1000, {d:"888888",dt:"number",s: "r"}, "武当山光明顶"],
	     			             ["张四丰", 1000, "888888", "武当山光明顶"],
	     			             ["张五丰", 1000, "888888", "武当山光明顶"],
	     			             ["张六丰", 1000, "888888", "武当山光明顶"],
	     			             ["张⑦丰", 1000, "888888", "武当山光明顶"]]
				}];
				callback(dataList);//必须
			},
			/**
			 * 导出模板数据集
			 * 
			 * data参数是对象
			 * @param {String} range 其中0表示全部；1表示单前页；2表示范围，参照rangeInput
			 * @param {String} rangeInput  1或5-12或5-
			 * @param {String} mode 其中0表示导出数据；1表示导出模板
			 * @param {String} fileType 其中0表示xlsx；1表示xls；2表示wps；3表示pdf
			 * @param {String} format 其中0表示主、子表多页签导出，1表示主、子表单页签导出（不支持导入）
			 * 
			 * callback参数是回调函数，需要调用者手动执行
			 * 
			 * @return {Array} 返回对象数组
			 */
			templateList : function(data, callback){
				var dataList =
				     		 [{
				      			 "tabName" : "简历",
				      			 "userData":[
				      			             [{d:"张三丰简历", s: "h|c", colspan:6}],
				      			             [{d:"姓名", s:"h|c"}, "", {d:"年龄", s:"h|c"}, 1000, {d:"地址", s:"h|c"}, ""],
				      			             [{d:"性别", s:"h|c"}, "", {d:"民族", s:"h|c"}, "", {d:"英文水平", s:"h|c"}, ""]
				      			            ]
				      		 }];
				callback(dataList);//必须
			}
	};
	ecpExport.doExport(option);
})